<?php

/**
 * 前台预览
 *
 * @author Administrator
 */

namespace Operation\Controller;

use Think\Controller;
use Think\IFilter;
use Think\IReq;
use Home\Model\Goods;

class SiteController extends ComController{

    public function home() {
       $goods_id = IFilter::act(IReq::get('id'), 'int');

        //初始化数据
        $goods_class = new Goods();

        //获取所有商品扩展相关数据
        $data = $goods_class->edit($goods_id);
        
        //dump($data);die;
        $this->assign('data',$data);
        
        $this->display();
    }
    
    public function article_detail(){
        $article_id = IFilter::act(IReq::get('id'), 'int');
        
        $ArticleObj = M('article');
        
        $article = $ArticleObj->find($article_id);
        $article['content'] = stripslashes($article['content']);
        
        $this->assign('data', $article);
        $this->display('article_detail');
    }

}

